﻿using MvcApplication.Common;
using MvcApplication.CommonWebApi.Domain;
using System.Data.Common;
using System.Linq;

namespace MvcApplication.CommonWebApi
{
    public class ConnCollection
    {
        public static ConnInfo Get(int connId)
        {
            var connInfo = CommonWebApiScriptLoader.ConnInfos.FirstOrDefault(t => t.Id == connId);
            if (connInfo == null)
            {
                throw new BizException(connId + " 数据库链接不存在");
            }

            return connInfo;
        }
    }
}
